﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceManager.Facade.TypeProjections;
using System.Text;
using Microsoft.EnterpriseManagement.Common;

namespace System.ServiceManager.Facade.EnterpriseManagementObjects
{
    public partial class System_User
    {

        //public static EnterpriseManagementObject GetFromEmail(string emailAddress)
        //{
        //    const string property = "$Target/Path[Relationship='SupportingItemLibrary!System.UserHasPreference' TypeConstraint='NotificationLibrary!System.Notification.Endpoint']/Property[Type='NotificationLibrary!System.Notification.Endpoint']/TargetAddress$";

        //    var criteriaFactory = new CriteriaBuilder();
        //    criteriaFactory.AddReferences("System.Notifications.Library", "NotificationLibrary");
        //    criteriaFactory.AddReferences("System.SupportingItem.Library", "SupportingItemLibrary");

        //    var criteria = criteriaFactory.CreateSimpleCriteria(TypeProjections.TypeProjections.System_User_Preferences_Projection,
        //                                                        property, emailAddress);

        //    return SCSMServer.GetObjectProjectionReader(criteria, ObjectQueryOptions.Default).FirstOrDefault().Object;

        //}
    }
}
